import { SpuImg } from '../spu/type'

export interface ResponseData {
  code: number
  message: string
  ok: boolean
}

export interface Attr {
  attrId: number | number
  valueId: number | number
  attrName?: string
  createTime?: string
  id?: number
  skuId?: number
  updateTime?: string
  valueName?: string
}

export interface SaleArr {
  saleAttrId: number | number
  saleAttrValueId: number | number
}

// sku类型
export interface SkuData {
  category3Id?: number | string
  spuId?: number | string
  tmId?: number | string
  skuName?: string
  price?: string | number
  weight?: string | number
  skuDesc?: string
  skuAttrValueList?: Attr[]
  skuSaleAttrValueList?: SaleArr[]
  skuDefaultImg?: string
  isSale?: number | string
  id?: number | string
  skuImageList?: SpuImg[]
  skuDetailLoading?: boolean
}

export interface SkuResponseData extends ResponseData {
  data: {
    records: SkuData[]
    total: number
    size: number
    current: number
    orders: []
    optimizeCountSql: boolean
    hitCount: boolean
    countId: null
    maxLimit: null
    searchCount: boolean
    pages: number
  }
}

//获取SKU商品详情接口的ts类型
export interface SkuInfoData extends ResponseData {
  data: SkuData
}
